package com.hyg.common.utils.glide;


import com.bumptech.glide.load.model.GlideUrl;

/**
 * Author: huangyuguang
 * Date: 2022/5/5
 */
public class ImageGlideUrl extends GlideUrl {

    public ImageGlideUrl(String url) {
        super(url);
    }





    public String getCacheKey() {
        String key = super.getCacheKey();

        if(key.startsWith("https://") || key.startsWith("http://")){
            String noHttpUrl = key.replace("https://","")
                    .replace("http://","");
            int index = noHttpUrl.indexOf("/");
            if(index > 0){
                key = noHttpUrl.substring(index+1);
            }
        }

        return key;
    }

}



